import { Component, OnInit, Input } from '@angular/core';
import { DataService } from '../../../service/data.service';

@Component({
  selector: 'app-menu-card',
  templateUrl: './menu-card.component.html',
  styleUrls: ['./menu-card.component.css']
})
export class MenuCardComponent implements OnInit {
  @Input() dishId: number;
  dish:any
  dishImgSrc:string
  constructor( private dataService:DataService ) { }

  ngOnInit(): void {
    let that = this
    this.dataService.getDish(this.dishId, dish=>that.dish=dish)
    this.dishImgSrc = this.dataService.getImageSrc(this.dishId)
  }
  that = this
  initDish(dish){
    this.that
  }
}
